//<a href="http://lib.csdn.net/base/softwaretest" class='replace_word' title="软件测试知识库" target='_blank' style='color:#df3434; font-weight:bold;'>测试</a>main函数  
//QuartzTest.<a href="http://lib.csdn.net/base/java" class='replace_word' title="Java 知识库" target='_blank' style='color:#df3434; font-weight:bold;'>Java</a>  
package org.wissyu.sample.quartz;  
  
  
import java.text.SimpleDateFormat;  
import java.util.Date;  
  
public class QuartzTest {  
  
    /** *//** 
     * @param args 
     */  
    public static void main(String[] args) {  
        // TODO Auto-generated method stub  
        SimpleDateFormat DateFormat = new SimpleDateFormat("yyyyMMddHHmmss");  
        Date d = new Date();  
        String returnstr = DateFormat.format(d);          
          
        TestJob job = new TestJob();  
        String job_name ="aaa";  
        try {  
            System.out.println(returnstr+ "【系统启动】");  
            QuartzManager.addJob(job_name,job,"0/2 * * * * ?"); //每2秒钟执行一次  
              
//            Thread.sleep(10000);  
//            System.out.println("【修改时间】");  
            QuartzManager.modifyJobTime(job_name,"0/1 * * * * ?");  
//            Thread.sleep(20000);  
//            System.out.println("【移除定时】");  
            QuartzManager.removeJob(job_name);  
//            Thread.sleep(10000);  
//              
//            System.out.println("/n【添加定时任务】");  
//            QuartzManager.addJob(job_name,job,"0/5 * * * * ?");  
              
        }  catch (Exception e) {  
            e.printStackTrace();  
        }  
    }  
}  